<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>params方式传参</title>
    <script src="vue.js"></script>
    <script src="vue-router.js"></script>
</head>
<body>
    <div id="app">
        <router-link to="/user/10/admin">登录</router-link>
        <router-view></router-view>
    </div>
    <script>
        var user={
        template:'<h3>id:{{$route.params.id}}'+'name:{{$route.params.name}}</h3>',
        created(){
            console.log(this.$route)
        }
    }
    var router=new VueRouter({
        routes:[
        {path:'/user/:id/:name',component:user}
        ]
    })
    var vm=new Vue({el:'#app',router})
    </script>
    
</body>
</html>